package com.gexiaobao.pigeon.ui.fragment.mine.banking.activity

import android.os.Bundle
import com.gexiaobao.pigeon.R
import com.gexiaobao.pigeon.app.base.BaseActivity
import com.gexiaobao.pigeon.app.ext.initClose
import com.gexiaobao.pigeon.app.util.RxToast
import com.gexiaobao.pigeon.databinding.FragmentTransferDetailBinding
import com.gexiaobao.pigeon.viewmodel.MineBankingViewModel
import me.hgj.jetpackmvvm.ext.parseState

/**
 * @author     xwhuj
 * @date       2025/2/14 10:12
 * @Describe   金融（订单详情）
 */
class ActivityAccountOrderDetail : BaseActivity<MineBankingViewModel, FragmentTransferDetailBinding>() {

    override fun initView(savedInstanceState: Bundle?) {
        mDatabind.includeBar.toolbar.initClose("订单详情") {
            finish()
        }
        val mOrderId = intent.getIntExtra("orderId", 0)
        showLoading(getString(R.string.loading))
        mViewModel.getOrderDetail(mOrderId)
    }

    override fun createObserver() {
        super.createObserver()
        mViewModel.orderDetailResult.observe(this) { resultState ->
            parseState(resultState, {
                mDatabind.data = it
            }, {
                RxToast.showToast(it.msg)
            })
        }
    }

}